import baseRequest from "@/axios/baseRequest"
import utils from "@/utils"
export default {
  getDataSource(params) {
    const tempParams = utils.jsonToQuery(params)
    console.log("params", params)
    return new Promise((resolve, reject) => {
      baseRequest.get(`bigdata-pv-backend/dataResource/pageDataResourceList?` + tempParams).then(data => {
        resolve(data)
      }).catch(e => {
        reject(e)
      })
    })
  },
  pageInspectTaskInfoList(params) {
    const tempParams = utils.jsonToQuery(params)
    console.log("params", params)
    return new Promise((resolve, reject) => {
      baseRequest.get(`bigdata-pv-backend/inspecttaskinfo/pageInspectTaskInfoList?` + tempParams).then(data => {
        resolve(data)
      }).catch(e => {
        reject(e)
      })
    })
  },
  deleteInspectTaskInfo(params) {
    console.log("params", params)
    return new Promise((resolve, reject) => {
      baseRequest.delete(`bigdata-pv-backend/inspecttaskinfo/deleteInspectTaskInfo`, {data: params}).then(data => {
        resolve(data)
      }).catch(e => {
        reject(e)
      })
    })
  },
  deleteDatareSourceInfo(params) {
    console.log("params", params)
    return new Promise((resolve, reject) => {
      baseRequest.delete(`bigdata-pv-backend/dataResource/deleteDataResourceInfo`, {data: params}).then(data => {
        resolve(data)
      }).catch(e => {
        reject(e)
      })
    })
  },
  getOriFileNameInfo(params) {
    const tempParams = utils.jsonToQuery(params)
    return new Promise((resolve, reject) => {
      baseRequest.get(`bigdata-pv-backend/dataResource/getOriFileNameInfo?` + tempParams).then(data => {
        resolve(data)
      }).catch(e => {
        reject(e)
      })
    })
  },
  insertTaskInfo(params) {
    const temParams = utils.jsonToQuery(params)
    return new Promise((resolve, reject) => {
      baseRequest.post(`bigdata-pv-backend/dataResource/insertTaskInfo?` + temParams).then(data => {
        resolve(data)
      }).catch(e => {
        reject(e)
      })
    })
  },
  getNameAndRemarkInfo(params) {
    const temParams = utils.jsonToQuery(params)
    return new Promise((resolve, reject) => {
      baseRequest.get(`bigdata-pv-backend/dataResource/getNameAndRemarkInfo?` + temParams).then(data => {
        resolve(data)
      }).catch(e => {
        reject(e)
      })
    })
  }
}
